package com.ruoyi.product.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.product.domain.GoodsOrders;
import com.ruoyi.product.mapper.GoodsOrdersMapper;
import com.ruoyi.product.service.IGoodsOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 订单管理Service业务层处理
 *
 * @author kzc
 * @date 2023-04-26
 */
@Service
public class GoodsOrdersServiceImpl implements IGoodsOrdersService
{
    @Autowired
    private GoodsOrdersMapper goodsOrdersMapper;

    /**
     * 查询订单管理
     *
     * @param sgoId 订单管理主键
     * @return 订单管理
     */
    @Override
    public GoodsOrders selectGoodsOrdersBySgoId(Integer sgoId)
    {
        return goodsOrdersMapper.selectGoodsOrdersBySgoId(sgoId);
    }

    /**
     * 查询订单管理列表
     *
     * @param goodsOrders 订单管理
     * @return 订单管理
     */
    @Override
    public List<GoodsOrders> selectGoodsOrdersList(GoodsOrders goodsOrders)
    {
        return goodsOrdersMapper.selectGoodsOrdersList(goodsOrders);
    }

    /**
     * 新增订单管理
     *
     * @param goodsOrders 订单管理
     * @return 结果
     */
    @Override
    public int insertGoodsOrders(GoodsOrders goodsOrders)
    {
        goodsOrders.setCreateTime(DateUtils.getNowDate());
        return goodsOrdersMapper.insertGoodsOrders(goodsOrders);
    }

    /**
     * 修改订单管理
     *
     * @param goodsOrders 订单管理
     * @return 结果
     */
    @Override
    public int updateGoodsOrders(GoodsOrders goodsOrders)
    {
        goodsOrders.setUpdateTime(DateUtils.getNowDate());
        return goodsOrdersMapper.updateGoodsOrders(goodsOrders);
    }

    /**
     * 批量删除订单管理
     *
     * @param sgoIds 需要删除的订单管理主键
     * @return 结果
     */
    @Override
    public int deleteGoodsOrdersBySgoIds(Integer[] sgoIds)
    {
        return goodsOrdersMapper.deleteGoodsOrdersBySgoIds(sgoIds);
    }

    /**
     * 删除订单管理信息
     *
     * @param sgoId 订单管理主键
     * @return 结果
     */
    @Override
    public int deleteGoodsOrdersBySgoId(Integer sgoId)
    {
        return goodsOrdersMapper.deleteGoodsOrdersBySgoId(sgoId);
    }

    @Override
    public int upstaf(Integer sgoId) {
        return goodsOrdersMapper.upstaf(sgoId);
    }

    @Override
    public int upstat(Integer sgoId) {
        return goodsOrdersMapper.upstat(sgoId);
    }
}
